//
//  PieChartViewController.h
//  MoneyLog
//
//  Created by wicresoft on 6/10/11.
//  Copyright 2011 wicresoft. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Database.h"
#import "MyDate.h"
@class pieChartView;
@class PieChartItem;

typedef enum {
    kPieChartControllerAll=0,
    kPieChartControllerIncome,
    kPieChartControllerExpense,
    kPieChartControllerSubExpense,
}PieChartControllerState;

@interface PieChartViewController : UIViewController<UITableViewDelegate,UITableViewDataSource> {
    UITableView                 *_tableView;
    NSMutableArray              *dataSourceArray;
    
    PieChartControllerState     controllerState;
    MyDate                      *searchStartDate;
    MyDate                      *searchEndDate;
    NSString                    *searchString;
    
    pieChartView                *chartView;
    UIView                      *titleView;
    UIButton                    *titleButton;
    
    UIView              *dateSelectView;
    UIPickerView        *startPickerView;
    UIPickerView        *endPickerView;
    NSMutableArray      *pikcerDataSource;
}

@property (nonatomic,retain) IBOutlet UITableView       *_tableView;
@property (nonatomic,retain) NSMutableArray             *dataSourceArray;
@property (assign)           PieChartControllerState    controllerState;
@property (nonatomic,retain) MyDate                     *searchStartDate;
@property (nonatomic,retain) MyDate                     *searchEndDate;
@property (nonatomic,retain) NSString                   *searchString;

@property (nonatomic,retain) pieChartView               *chartView;

@property (nonatomic,retain) IBOutlet UIView              *dateSelectView;
@property (nonatomic,retain) IBOutlet UIPickerView        *startPickerView;
@property (nonatomic,retain) IBOutlet UIPickerView        *endPickerView;
@property (nonatomic,retain)  NSMutableArray              *pikcerDataSource;

-(void) statRecord:(PieChartControllerState) state;
-(void)getPieChartController ;
-(id)tableCellView:(PieChartItem *)item frame:(CGRect)frame;

-(IBAction)cancelAction;
-(IBAction)doneAction;

@end
